package org.example.kg_back.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.kg_back.PoJo.entity.Callsaturation;
import org.example.kg_back.mapper.CallsaturationMapper;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class CallsaturationService extends ServiceImpl<CallsaturationMapper, Callsaturation> {

	/**
	 * 查询各扇区通话饱和度
	 * @return
	 */
	public Map<String,String> findCallSaturation(){
		Map<String,String> map = new HashMap<>();
		List<Callsaturation> callSaturation = baseMapper.findCallSaturation();

		for (Callsaturation c:callSaturation ) {
			map.put(c.getThbhSect(),String.valueOf((Double.parseDouble(c.getThbhValue())*100)));
		}
		return map;
	}
}
